/*
 * User: rant
 * Date: 07/01/2007
 *
 *
 */
package laMalinche.rete.rule;

/**
 *
 */
public enum BusinessRuleType {
	productionRule,
	derivedInSession,
	constraint,
	substituteUnknownValue,
	old_fortest_suggestedValue,
	//this type ignore editable context
	derived,
	//this type ignore editable context
	suggestedValue;


	public boolean isEditableContextSensitive() {
		return equals(constraint) ||
                equals(substituteUnknownValue) ||
                equals(derivedInSession) ||
                equals(productionRule);
	}

	public boolean isDerivationField(){
		return equals(old_fortest_suggestedValue) ||
                equals(substituteUnknownValue) ||
                equals(suggestedValue) ||
                equals(derivedInSession);
	}

	public boolean isDefault() {
		return equals(old_fortest_suggestedValue) ||
                equals(substituteUnknownValue) ||
                equals(suggestedValue);
	}

	/**
	 return true when business rule  fire activation is one of the production rule conditions
	 @return
	 */
	public boolean isTriger(){
		return !equals(constraint);
	}
}